package com.ruoyi.location.repository.dao;

import com.ruoyi.location.repository.generator.entity.LocationReportRecord;
import com.ruoyi.location.repository.generator.entity.QuickReportLocation;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface QuickReportDao {

    /**
     * 根据room和name查询最新的位置记录
     * @param room 房间号
     * @param name 用户名
     * @return 最新的位置记录
     */
    @Select({
            "SELECT id, room, name, longitude, latitude, ctime",
            "FROM quick_report_location",
            "WHERE room = #{room} AND name = #{name}",
            "ORDER BY ctime DESC",
            "LIMIT 1"
    })
    QuickReportLocation selectLatestByRoomAndName(@Param("room") String room, @Param("name") String name);

}
